﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ModelLayer;
using DBLayer;

/// <summary>
/// Controller to control Persons 
/// </summary>
namespace CtrLayer
{
    public class PersonCtr
    {
        //Variables initialization
        private PersonDB personDB;
        //constructor
        public PersonCtr()
        {
            personDB = new PersonDB();
        }
        #region Customer
        //Insert Customer in the database
        public int InsertCustomer(Customer _customer)
        {
            return personDB.InsertCustomer(_customer);
        }
        //Find Person in the database
        public Customer FindCustomerByPhoneNumber(int _phoneNo)
        {
            return personDB.FindCustomerByPhoneNumber(_phoneNo);
        }
        //select all customers
        public List<Customer>SelectAll()
        {
            return personDB.SelectAll();
        }
        //Updates customer in the database
        public int UpdateCustomer(Customer _customer)
        {
            return personDB.UpdateCustomer(_customer);
        }
        //remove Customer in the database
        public int RemoveCustomer(Customer _customer)
        {
            return personDB.RemoveCustomer(_customer);
        }
        #endregion

    }
}
